# Maintainer: Filipe Laíns (FFY00) <lains@archlinux.org>

pkgname=libosmosdr
_pkgname=osmo-sdr
_commit=ba4fd96622606620ff86141b4d0aa564712a735a
pkgver=0.1.r10.gba4fd96
pkgrel=3
pkgdesc='Library to communicate with OsmoSDR devices'
arch=('loong64' 'x86_64')
url='https://sdr.osmocom.org/trac/'
license=('GPL3')
depends=(libusb)
makedepends=('git' 'cmake')
source=("git+https://git.osmocom.org/osmo-sdr#commit=$_commit")
sha512sums=('SKIP')

pkgver() {
  cd "$srcdir"/$_pkgname
  git describe --long | sed 's/^v//g;s/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
  mkdir -p $_pkgname/build
  cd $_pkgname/build

  cmake ../software/libosmosdr \
  	-DCMAKE_INSTALL_PREFIX=/usr \
  	-DCMAKE_BUILD_TYPE=Release

  make
}

package() {
  cd $_pkgname/build

  make DESTDIR="$pkgdir" install
}

